import { NextRequest, NextResponse } from 'next/server'
import { generateMockData } from '@/lib/mockData'

export async function GET(request: NextRequest) {
  const searchParams = request.nextUrl.searchParams
  const page = parseInt(searchParams.get('page') || '1')
  const limit = parseInt(searchParams.get('limit') || '20')
  
  // 模拟API延迟
  await new Promise(resolve => setTimeout(resolve, 500))
  
  const posts = generateMockData(limit)
  
  return NextResponse.json({
    posts,
    hasMore: page < 10,
    page,
    limit,
  })
}
